package day2;

import java.text.NumberFormat;

public class Fruit {
    public Object number(){return 10;}
    public void print(){
        System.out.println("Fruit");
    }
    public static void main(String[] args) {
        Fruit f1 = new Apple();
        Fruit f2 = new Orange();
        Fruit f3 = new Banana();
        f1.print();
        f2.print();
        f3.print();
    }
}
class Apple extends Fruit{
    @Override
    public void print() {
        System.out.println("apple");
    }

    @Override
    public Integer number() {
        return 10;
    }
}
class Orange extends Fruit{
    @Override
    public void print() {
        System.out.println("orange");
    }
}
class Banana extends Fruit{
    @Override
    public void print() {
        System.out.println("banana");
    }
}
